import { RouteRecordRaw } from 'vue-router'

import Layout from '../layout/index.vue'
import StartPage from '../views/start/index.vue'
import RoomList from '../views/room-list/index.vue'

export const routes: RouteRecordRaw[] = [
  {
    path:'/center',
    component:RoomList
  },
  {
    name:'start',
    path:'/start',
    component:StartPage
  },
  {
    path: '/',
    component: Layout,
    beforeEnter:(to,_a)=>{
      const query = to.query
      if(!query.model){
        return {name:'start'}
      }
    }
  }
]
